package com.wzy.vx.converter;

import com.wzy.vx.DTO.OrderDTO;
import com.wzy.vx.dataobject.OrderMaster;
import org.springframework.beans.BeanUtils;

import java.util.List;
import java.util.stream.Collectors;

/**
 * @ProjectName: vx
 * @Package: com.wzy.vx.converter
 * @ClassName: OrderMasterConOrderDTO
 * @Author: Administrator
 * @Description: ${description}
 * @Date: 2019/3/13 17:28
 * @Version: 1.0
 */
public class OrderMasterConOrderDTO {
    public static OrderDTO convert(OrderMaster orderMaster) {
        OrderDTO orderDTO = new OrderDTO();
        BeanUtils.copyProperties(orderMaster, orderDTO);
        return orderDTO;
    }

    public static List<OrderDTO> convert(List<OrderMaster> orderMasterList) {
        return orderMasterList.stream().map(e ->
                convert(e)
        ).collect(Collectors.toList());
    }
}
